window.onload = function() {

	oText = document.getElementsByTagName('input')[0];
	oUl = document.getElementsByTagName('ul')[0];

	oText.addEventListener('keydown', send, false);

};

var oText = null;
var oUl = null;

function send(ev) {
	ev = ev || event;
	if( this.value !== '') {
		if(ev.keyCode == 13 && ev.ctrlKey) {
			var oLi = document.createElement('li');
			oLi.innerHTML = this.value;
			if(oUl.children[0]) {
				oUl.insertBefore(oLi, oUl.children[0]);
			} else {
				oUl.appendChild(oLi);
			}
			this.value = '';
		}
	}

}
